package com.xiaoshuidi.cloud.module.finance.api.invoice;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Tag(name = "RPC 服务 - 开票")
@FeignClient(name = "lease-finance-server")
public interface InvoiceApi {
    /**
     * 税号配置费项及税率
     * @param invoiceConfigId
     * @return
     */
    @GetMapping("/rpc-api/finance/invoice/invoicable-fees")
    CommonResult<Set<Long>> invoicableFeeId(@RequestParam("invoiceConfigId") Integer invoiceConfigId);

    /**
     * 通过门店id获取配置的费项
     * @param apartmentIds
     * @return
     */
    @PostMapping("/rpc-api/finance/invoice/invoicable-fees-map")
    CommonResult<Map<Long, List<Long>>> getInvoiceTaxMap(@RequestBody Collection<Long> apartmentIds);

    /**
     * 订单红冲
     * @param orderIds
     * @return
     */
    @GetMapping("/rpc-api/finance/invoice/invoice-red")
    CommonResult<List<Long>> invoiceRed(@RequestParam("orderIds") List<Long> orderIds);
}
